x86/EFI: use less crude a way of generating the build ID
authorJan Beulich <jbeulich@suse.com>
Thu, 1 Sep 2016 13:19:40 +0000 (15:19 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 1 Sep 2016 13:19:40 +0000 (15:19 +0200)
commiteee5909e9d1e9fa991c7d76475612354c5a6729c
tree654d0e8e53ee30fbf55efbcf6fe0996542215263
parent08e7738ec3644350fbac0325085baac6b3c7cd11
x86/EFI: use less crude a way of generating the build ID

Recent enough binutils (2.25 onwards) support --build-id also for
COFF/PE output, and hence we should use that in favor of the original
hack when possible.

This gets complicated by the linker requiring at least one COFF object
file to attach the .buildid section to. Hence the patch introduces a
buildid.ihex (in order to avoid introducing binary files into the repo)
which then gets converted to a binary minimal COFF object (no sections,
no symbols).

Also (to avoid both code fragment going out of sync) remove an unneeded
ALIGN() from xen.lds.S: Adding an equivalent of it to the .buildid
section would cause the _erodata symbol to become associated with the
wrong section again (see commit 0970299de5 ["x86/EFI + Live Patch:
avoid symbol address truncation"]). And it's pointless because the
alignment already gets properly set by the input section(s).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/Makefile
xen/arch/x86/efi/Makefile
xen/arch/x86/efi/buildid.ihex [new file with mode: 0644]
xen/arch/x86/efi/mkreloc.c
xen/arch/x86/xen.lds.S
xen/common/version.c